1. Technical Field
The present invention relates to a write cache for storage devices. More specifically, it relates to dynamic optimization of device limits and thresholds in a write cache.
2. Background Information
Storage adapters in a computer system often implement a write cache to enhance performance. The write cache is typically non-volatile (e.g. battery backed), and is used to mask the write penalty from storage devices such as those in a RAID (redundant array of independent disks) configuration. A write cache can also improve the performance of a storage adapter by coalescing multiple host operations placed in the write cache into a single destage operation which is then processed by the RAID layers or disk devices.
The size of write caches has grown dramatically over time due to both the size increase of memory chips and the utilization of compression techniques applied to compress the data in the caches. Although disk drive capacities have also greatly increased, the number of random operations per second that a disk drive can process has not increased as significantly. Therefore, a large amount of data may be placed into a write cache for a disk drive, which will take an excessive amount of time to flush when, for example, the storage subsystem needs to be shutdown. For example, in a storage adapter with a 1.5 GB write cache, if the entire write cache can be filled with data for a single disk drive, it can take tens of minutes to destage the write cache to the disk drive when the data are stored in randomly placed small blocks.
Usually write caches need to be flushed within a short amount of time. Hence, a limit is established to prevent the write cache from being populated with too much data for a single disk drive. Some storage adapters establish a “Per Device Limit” as the limit. For example, a storage adapter can set a 100 MB “Per Device Limit”, thus limiting the time required to destage the write cache data. However, “Per Device Limit” is based on worst case destage operations when the data are stored in randomly placed small blocks, and this limit is fixed for all scenarios. Some storage adapters also use a “Per Device Threshold”. When the “Per Device Threshold” is reached, the write cache is destaged to the device to attempt to avoid the “cache full” condition. The “Per Device Threshold”, however, is not optimized for fair use of the write cache by all disk drives attached to the adapter, and this threshold is determined beforehand. Hence, these limits cannot be adjusted dynamically to achieve optimal performance.